﻿<ResourceDictionary
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:mCls="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
	xmlns:lmControls="clr-namespace:LegoMachine.UI.Controls"
	xmlns:behavior="clr-namespace:LegoMachine.UI.Behavior"
	xmlns:converters="clr-namespace:LegoMachine.UI.Converters"
    xmlns:lmVmItem="clr-namespace:LegoMachine.ViewModel.Item">

	<converters:BoolToVisibilityConverter x:Key="FalseToVisibleConverter" FalseValue="Visible" TrueValue="Collapsed" />
	<converters:BoolToVisibilityConverter x:Key="TrueToVisibleConverter" FalseValue="Collapsed" TrueValue="Visible" />
	<converters:NullToVisibilityConverter x:Key="NullToVisibilityConverter" NullValue="Visible" NotNullValue="Collapsed" />
	<converters:NullToVisibilityConverter x:Key="NotNullToVisibilityConverter" NullValue="Collapsed" NotNullValue="Visible" />
	<converters:NullableConverter x:Key="NullableConverter" />
	<converters:NullableVisibilityConverter x:Key="NullableVisibilityConverter" />
	<converters:MultiplyConverter x:Key="MultiplyConverter" />
	<converters:RuleItemVMToStringConverter EmptyLetterValueString="●" FinalStateString="■" x:Key="RuleItemVMToStringConverter" />
	<converters:LetterItemVMToStringConverter EmptyLetterValueString="●" x:Key="LetterItemVMToStringConverter" />
	<converters:StateItemVMToStringConverter FinalStateString="■" x:Key="StateItemVMToStringConverter" />

	<Color x:Key="AccentColor">#FF007BFF</Color>
	<Color x:Key="DarkColor">#FF525252</Color>

	<SolidColorBrush x:Key="AccentBrush" Color="{DynamicResource AccentColor}" />
	<SolidColorBrush x:Key="DarkBrush" Color="{DynamicResource DarkColor}" />

	<Style x:Key="TextBlockStyleHeader" TargetType="TextBlock">
		<Setter Property="FontFamily" Value="Segoe UI" />
		<Setter Property="FontSize" Value="30" />
	</Style>

	<Style x:Key="TextBlockStyleAccentHeader" TargetType="TextBlock">
		<Setter Property="FontFamily" Value="Segoe UI" />
		<Setter Property="FontSize" Value="30" />
		<Setter Property="Foreground" Value="{DynamicResource AccentBrush}" />
	</Style>

	<Style x:Key="TextBlockStyleSubHeader" TargetType="TextBlock">
		<Setter Property="FontFamily" Value="Segoe UI Semibold" />
		<Setter Property="FontSize" Value="18" />
		<Setter Property="Foreground" Value="{DynamicResource DarkBrush}" />
	</Style>

	<Style x:Key="TextBlockStyleAccentSubHeader" TargetType="TextBlock">
		<Setter Property="FontFamily" Value="Segoe UI Semibold" />
		<Setter Property="FontSize" Value="18" />
		<Setter Property="Foreground" Value="{DynamicResource AccentBrush}" />
	</Style>

	<Style x:Key="TextBlockStyleSecondarySubHeader" TargetType="TextBlock">
		<Setter Property="FontFamily" Value="Segoe UI Light" />
		<Setter Property="FontSize" Value="20" />
		<Setter Property="Opacity" Value="0.6" />
	</Style>

	<Style x:Key="TextBlockStyleAccentSecondarySubHeader" TargetType="TextBlock">
		<Setter Property="FontFamily" Value="Segoe UI Light" />
		<Setter Property="FontSize" Value="20" />
		<Setter Property="Opacity" Value="0.6" />
		<Setter Property="Foreground" Value="{DynamicResource AccentBrush}" />
	</Style>

	<Style x:Key="TextBlockStyleSmallSubHeader" TargetType="TextBlock">
		<Setter Property="FontFamily" Value="Segoe UI Semibold" />
		<Setter Property="FontSize" Value="11" />
	</Style>

	<Style x:Key="TextBlockStyleAccentSmallSubHeader" TargetType="TextBlock">
		<Setter Property="FontFamily" Value="Segoe UI Semibold" />
		<Setter Property="FontSize" Value="11" />
		<Setter Property="Foreground" Value="{DynamicResource AccentBrush}" />
	</Style>

	<Style x:Key="TextBlockStyleSmallSecondarySubHeader" TargetType="TextBlock">
		<Setter Property="FontFamily" Value="Segoe UI Semibold" />
		<Setter Property="FontSize" Value="11" />
		<Setter Property="Opacity" Value="0.6" />
	</Style>

	<Style x:Key="TextBlockStyleAccentSmallSecondarySubHeader" TargetType="TextBlock">
		<Setter Property="FontFamily" Value="Segoe UI Semibold" />
		<Setter Property="FontSize" Value="11" />
		<Setter Property="Opacity" Value="0.6" />
		<Setter Property="Foreground" Value="{DynamicResource AccentBrush}" />
	</Style>

	<Style x:Key="TextBlockStyleBodyText" TargetType="TextBlock">
		<Setter Property="FontFamily" Value="Segoe UI Semilight" />
		<Setter Property="FontSize" Value="11" />
	</Style>

	<Style x:Key="TextBlockStyleSecondaryBodyText" TargetType="TextBlock">
		<Setter Property="FontFamily" Value="Segoe UI Semilight" />
		<Setter Property="FontSize" Value="11" />
		<Setter Property="Opacity" Value="0.6" />
		<Setter Property="TextWrapping" Value="WrapWithOverflow" />
	</Style>

	<Style x:Key="CellControlStyleDefault" TargetType="lmControls:CellControl">
		<Setter Property="IsTabStop" Value="False" />
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="lmControls:CellControl">
					<Grid Name="LayoutRoot" Margin="0,6">
						<Grid.Style>
							<Style TargetType="Grid">
								<Style.Triggers>
									<DataTrigger Binding="{Binding Path=ValueState, Mode=OneWay}">
										<DataTrigger.Value>
											<lmVmItem:CellValueState>Known</lmVmItem:CellValueState>
										</DataTrigger.Value>
										<Setter Property="Opacity" Value="1" />
									</DataTrigger>
									<!--<DataTrigger Binding="{Binding Path=ValueState, Mode=OneWay}">
										<DataTrigger.Value>
											<lmVmItem:CellValueState>Unknown</lmVmItem:CellValueState>
										</DataTrigger.Value>
										<Setter Property="Opacity" Value="0.55" />
									</DataTrigger>
									<DataTrigger Binding="{Binding Path=ValueState, Mode=OneWay}">
										<DataTrigger.Value>
											<lmVmItem:CellValueState>Unused</lmVmItem:CellValueState>
										</DataTrigger.Value>
										<Setter Property="Opacity" Value="0.55" />
									</DataTrigger>-->
								</Style.Triggers>
							</Style>
						</Grid.Style>
						<Grid.RowDefinitions>
							<RowDefinition Height="Auto" />
							<RowDefinition Height="*" />
						</Grid.RowDefinitions>
						<TextBlock
                            Grid.Row="0" Margin="4,0,0,0" Height="40"
                            VerticalAlignment="Center" HorizontalAlignment="Center"
							TextAlignment="Center" Focusable="False"
                            Text="{Binding Path=CurrentValue, Mode=OneWay, Converter={StaticResource LetterItemVMToStringConverter}}"
                            FontWeight="Bold" FontSize="16">
						</TextBlock>
						<Rectangle
                            Margin="1,0,0,0" Opacity="0.4"
							Grid.Row="1"
                            Visibility="{Binding Path=IsActive, Mode=OneWay, Converter={StaticResource TrueToVisibleConverter}}"
							Fill="Gray">
							<Rectangle.Effect>
								<BlurEffect Radius="2" />
							</Rectangle.Effect>
						</Rectangle>
						<Grid
							x:Name="PART_CellLayout"
							Grid.Row="1"
							behavior:GridBehavior.RowsCount="{Binding Path=AttachedBasicConfig.Alphabet.Count, Mode=OneWay}">
							<ContentControl
								x:Name="PART_CurrentValueControl"
								IsTabStop="False" Focusable="False"
								Visibility="{Binding Path=CurrentValue.ValueIndex, Converter={StaticResource NullableVisibilityConverter}, Mode=OneWay}"
								Grid.Row="{Binding Path=CurrentValue.ValueIndex, Converter={StaticResource NullableConverter}, Mode=OneWay}"
								VerticalAlignment="Stretch" VerticalContentAlignment="Stretch"
								HorizontalAlignment="Stretch" HorizontalContentAlignment="Stretch">
								<Grid Width="30" Height="30" VerticalAlignment="Center" Margin="14,0,14,0" HorizontalAlignment="Center">
									<Rectangle Margin="2,-2,-6,0" Fill="Black" Opacity="0.27" RadiusX="4" RadiusY="4">
										<Rectangle.Effect>
											<BlurEffect RenderingBias="Quality" Radius="11" />
										</Rectangle.Effect>
									</Rectangle>
									<Border Width="6" HorizontalAlignment="Left" Background="{TemplateBinding Background}" BorderBrush="DimGray" BorderThickness="0.5,0.5,0.5,0.5">
										<Border.RenderTransform>
											<TransformGroup>
												<SkewTransform AngleY="-45" />
											</TransformGroup>
										</Border.RenderTransform>
									</Border>
									<Border Height="6" VerticalAlignment="Bottom" Background="{TemplateBinding Background}" BorderBrush="DimGray" BorderThickness="0.5,0.5,0.5,0.5" Margin="6,0,-6,0">
										<Border.RenderTransform>
											<TransformGroup>
												<SkewTransform AngleX="-45" />
											</TransformGroup>
										</Border.RenderTransform>
									</Border>
									<Border Height="6" VerticalAlignment="Bottom" BorderBrush="Transparent" BorderThickness="0.5,0.5,0.5,0.5" Margin="6,0,-6,0" Opacity="0.20">
										<Border.RenderTransform>
											<TransformGroup>
												<SkewTransform AngleX="-45" />
											</TransformGroup>
										</Border.RenderTransform>
										<Border.Background>
											<LinearGradientBrush EndPoint="1,0.5" StartPoint="0,0.5">
												<GradientStop Color="Transparent" Offset="0" />
												<GradientStop Color="Black" Offset="1" />
											</LinearGradientBrush>
										</Border.Background>
									</Border>
									<Border VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Background="{TemplateBinding Background}"  BorderBrush="DimGray" BorderThickness="0,0.5,0.5,0" Margin="6,-6,-6,6" />
									<Border VerticalAlignment="Stretch" HorizontalAlignment="Stretch" BorderBrush="Transparent" BorderThickness="0,0.5,0.5,0" Margin="6,-6,-6,6" Opacity="0.20">
										<Border.Background>
											<LinearGradientBrush EndPoint="1,0" StartPoint="0,1">
												<GradientStop Color="Transparent" Offset="0" />
												<GradientStop Color="Black" Offset="1" />
											</LinearGradientBrush>
										</Border.Background>
									</Border>
									<Grid Margin="6,-5,-5,6">
										<Grid.RowDefinitions>
											<RowDefinition />
											<RowDefinition />
										</Grid.RowDefinitions>
										<Grid.ColumnDefinitions>
											<ColumnDefinition />
											<ColumnDefinition />
										</Grid.ColumnDefinitions>
										<Ellipse Grid.Row="0" Grid.Column="0" Width="8" Height="8" StrokeThickness="0.5" Stroke="DimGray" Fill="{TemplateBinding Background}"></Ellipse>
										<Ellipse Grid.Row="0" Grid.Column="0" Width="8" Height="8" Margin="1,-1,-1,1" StrokeThickness="0.5" Stroke="DimGray" Fill="{TemplateBinding Background}"></Ellipse>
										<Ellipse Grid.Row="1" Grid.Column="0" Width="8" Height="8" StrokeThickness="0.5" Stroke="DimGray" Fill="{TemplateBinding Background}"></Ellipse>
										<Ellipse Grid.Row="1" Grid.Column="0" Width="8" Height="8" Margin="1,-1,-1,1" StrokeThickness="0.5" Stroke="DimGray" Fill="{TemplateBinding Background}"></Ellipse>
										<Ellipse Grid.Row="0" Grid.Column="1" Width="8" Height="8" StrokeThickness="0.5" Stroke="DimGray" Fill="{TemplateBinding Background}"></Ellipse>
										<Ellipse Grid.Row="0" Grid.Column="1" Width="8" Height="8" Margin="1,-1,-1,1" StrokeThickness="0.5" Stroke="DimGray" Fill="{TemplateBinding Background}"></Ellipse>
										<Ellipse Grid.Row="1" Grid.Column="1" Width="8" Height="8" StrokeThickness="0.5" Stroke="DimGray" Fill="{TemplateBinding Background}"></Ellipse>
										<Ellipse Grid.Row="1" Grid.Column="1" Width="8" Height="8" Margin="1,-1,-1,1" StrokeThickness="0.5" Stroke="DimGray" Fill="{TemplateBinding Background}"></Ellipse>
									</Grid>
								</Grid>
							</ContentControl>
						</Grid>
					</Grid>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>

	<Style x:Key="TapeControlStyleDefault" TargetType="lmControls:TapeControl">
		<Setter Property="AlphabetItemTemplate">
			<Setter.Value>
				<DataTemplate>
					<Grid>
						<TextBlock
                            Margin="0,0,0,0"
                            VerticalAlignment="Center" HorizontalAlignment="Center"
							TextAlignment="Center" Focusable="False"
                            Text="{Binding Path=., Mode=OneWay, Converter={StaticResource LetterItemVMToStringConverter}}"
                            FontWeight="Bold" FontSize="16">
						</TextBlock>
					</Grid>
				</DataTemplate>
			</Setter.Value>
		</Setter>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="lmControls:TapeControl">
					<Grid x:Name="LayoutRoot" Grid.IsSharedSizeScope="True">
						<Grid.ColumnDefinitions>
							<ColumnDefinition Width="25" SharedSizeGroup="AlphabetSizeGroup" />
							<ColumnDefinition Width="*" />
							<ColumnDefinition Width="25" SharedSizeGroup="AlphabetSizeGroup" />
						</Grid.ColumnDefinitions>
						<ScrollViewer
                            Grid.Column="1" Margin="0,12,0,0"
							IsTabStop="False" Focusable="False"
                            HorizontalContentAlignment="Left"
                            HorizontalScrollBarVisibility="Visible" VerticalScrollBarVisibility="Auto">
							<ItemsControl
								ItemsSource="{TemplateBinding Cells}"
								IsTabStop="False" Focusable="False"
								ScrollViewer.HorizontalScrollBarVisibility="Disabled"
								ScrollViewer.VerticalScrollBarVisibility="Disabled">
								<ItemsControl.ItemsPanel>
									<ItemsPanelTemplate>
										<StackPanel Orientation="Horizontal" />
									</ItemsPanelTemplate>
								</ItemsControl.ItemsPanel>
								<ItemsControl.ItemTemplate>
									<DataTemplate>
										<Grid>
											<lmControls:CellControl
												IsTabStop="False" Focusable="False"
                                                HorizontalAlignment="Stretch" HorizontalContentAlignment="Stretch"
                                                VerticalAlignment="Stretch" VerticalContentAlignment="Stretch"
                                                Cell="{Binding}">
											</lmControls:CellControl>
											<Line
                                                Stroke="LightGray" Opacity="0.8"
												StrokeDashArray="4,3" StrokeThickness="1.5"
                                                HorizontalAlignment="Left" VerticalAlignment="Stretch"
                                                Width="2" X1="0" X2="0" Y1="0" Y2="1" Stretch="Fill"
												StrokeStartLineCap="Round" StrokeEndLineCap="Round"
												StrokeLineJoin="Round" StrokeDashCap="Round">
												<Line.OpacityMask>
													<LinearGradientBrush EndPoint="0.5,0" StartPoint="0.5,1">
														<GradientStop Color="Transparent" Offset="0"/>
														<GradientStop Color="Black" Offset="0.15"/>
														<GradientStop Color="Black" Offset="0.85"/>
														<GradientStop Color="Transparent" Offset="1"/>
													</LinearGradientBrush>
												</Line.OpacityMask>
											</Line>
										</Grid>
									</DataTemplate>
								</ItemsControl.ItemTemplate>
							</ItemsControl>
						</ScrollViewer>
						<Grid Grid.Column="0">
							<Rectangle
                                HorizontalAlignment="Right"
                                Width="4" Margin="0,8,0,8"
                                Fill="Black" Opacity="0.75"
                                RadiusX="16" RadiusY="16">
								<Rectangle.Effect>
									<BlurEffect Radius="15" />
								</Rectangle.Effect>
							</Rectangle>
							<Border BorderThickness="0,0,0.5,0" Background="White">
								<Border.BorderBrush>
									<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
										<GradientStop Color="Gray" Offset="0.95"/>
										<GradientStop Color="#00808080" Offset="1"/>
										<GradientStop Color="Gray" Offset="0.05"/>
										<GradientStop Color="#00808080"/>
									</LinearGradientBrush>
								</Border.BorderBrush>
							</Border>
							<ItemsControl
								IsTabStop="False" Focusable="False"
								Margin="0,52,0,20" HorizontalAlignment="Left"
								ItemsSource="{TemplateBinding Alphabet}" ItemTemplate="{TemplateBinding AlphabetItemTemplate}"
								Opacity="0.35">
								<ItemsControl.ItemsPanel>
									<ItemsPanelTemplate>
										<lmControls:GridPanel />
									</ItemsPanelTemplate>
								</ItemsControl.ItemsPanel>
							</ItemsControl>
						</Grid>
						<Grid Grid.Column="2">
							<Rectangle
                                HorizontalAlignment="Left"
                                Width="4" Margin="0,8,0,8"
                                Fill="Black" Opacity="0.75"
                                RadiusX="16" RadiusY="16">
								<Rectangle.Effect>
									<BlurEffect Radius="15" />
								</Rectangle.Effect>
							</Rectangle>
							<Border BorderThickness="0.5,0,0,0" Background="White">
								<Border.BorderBrush>
									<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
										<GradientStop Color="Gray" Offset="0.95"/>
										<GradientStop Color="#00808080" Offset="1"/>
										<GradientStop Color="Gray" Offset="0.05"/>
										<GradientStop Color="#00808080"/>
									</LinearGradientBrush>
								</Border.BorderBrush>
							</Border>
							<ItemsControl
								IsTabStop="False" Focusable="False"
								Margin="0,52,0,20" HorizontalAlignment="Right"
								ItemsSource="{TemplateBinding Alphabet}" ItemTemplate="{TemplateBinding AlphabetItemTemplate}"
								Opacity="0.35">
								<ItemsControl.ItemsPanel>
									<ItemsPanelTemplate>
										<lmControls:GridPanel />
									</ItemsPanelTemplate>
								</ItemsControl.ItemsPanel>
							</ItemsControl>
						</Grid>
					</Grid>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>

	<Style x:Key="ChildWindowStyleDefault" TargetType="lmControls:ChildWindow">
		<Setter Property="Visibility" Value="{Binding RelativeSource={RelativeSource Mode=Self}, Path=IsOpen, Converter={StaticResource TrueToVisibleConverter}}" />
		<Setter Property="IsOpen" Value="False" />
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="lmControls:ChildWindow">
					<Grid x:Name="LayoutRoot">
						<Rectangle Fill="Black" Opacity="0.4" />
						<Grid HorizontalAlignment="Center" VerticalAlignment="Center">
							<Rectangle Fill="Black" Opacity="0.6" Margin="-2">
								<Rectangle.Effect>
									<BlurEffect RenderingBias="Quality" Radius="30" />
								</Rectangle.Effect>
							</Rectangle>
							<Border Background="White" BorderBrush="Gray">
								<Grid>
									<Grid.RowDefinitions>
										<RowDefinition Height="Auto" />
										<RowDefinition Height="Auto" />
										<RowDefinition />
										<RowDefinition Height="Auto" />
										<RowDefinition Height="Auto" />
									</Grid.RowDefinitions>
									<StackPanel Grid.Row="0" HorizontalAlignment="Left" Margin="12,12,0,12">
										<Rectangle Height="3" Fill="{DynamicResource AccentBrush}" />
										<ContentControl Content="{TemplateBinding HeaderContent}" />
									</StackPanel>
									<Button
										Grid.Row="0" x:Name="PART_CloseButton"
										HorizontalAlignment="Right" VerticalAlignment="Center"
										Width="15" Height="15"
										Margin="0,12,12,12">
										<Button.Template>
											<ControlTemplate TargetType="Button">
												<Grid Background="Transparent" Width="15" Height="15">
													<Line X1="0" Y1="0" X2="1" Y2="1" Stroke="Gray" StrokeThickness="3" Stretch="Fill" />
													<Line X1="0" Y1="1" X2="1" Y2="0" Stroke="Gray" StrokeThickness="3" Stretch="Fill" />
												</Grid>
											</ControlTemplate>
										</Button.Template>
									</Button>
									<Border Grid.Row="1" BorderThickness="0,0.5,0,0" BorderBrush="Gray" />
									<ContentPresenter
										Grid.Row="2" Margin="12,12,12,12" ContentSource="Content"
										HorizontalAlignment="Stretch" VerticalAlignment="Stretch" />
									<Border Grid.Row="3" BorderThickness="0,0.5,0,0" BorderBrush="Gray" />
									<ContentControl
										Grid.Row="4" Margin="12,12,12,12" Content="{TemplateBinding FooterContent}"
										HorizontalAlignment="Stretch" VerticalAlignment="Stretch" />
								</Grid>
							</Border>
						</Grid>
					</Grid>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>

	<Style x:Key="GroupBoxSimpleStyle" TargetType="GroupBox">
		<Setter Property="BorderThickness" Value="0" />
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="GroupBox">
					<Grid>
						<Grid.RowDefinitions>
							<RowDefinition Height="Auto" />
							<RowDefinition Height="8" />
							<RowDefinition Height="*" />
						</Grid.RowDefinitions>
						<TextBlock Grid.Row="0" Text="{TemplateBinding Header}" Style="{StaticResource TextBlockStyleSmallSubHeader}" />
						<ContentPresenter Grid.Row="2" ContentSource="Content" Margin="{TemplateBinding Padding}" />
					</Grid>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>

	<Style x:Key="BigCircleButtonStyle" TargetType="Button">
		<Setter Property="Cursor" Value="Hand" />
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="Button">
					<Grid>
						<Ellipse Fill="White" Margin="0" Opacity="0.25">
							<Ellipse.Effect>
								<BlurEffect Radius="30" />
							</Ellipse.Effect>
						</Ellipse>
						<Ellipse Fill="{TemplateBinding Background}" Margin="20">
							<Ellipse.Effect>
								<DropShadowEffect Opacity="0.35" Direction="-90" />
							</Ellipse.Effect>
						</Ellipse>
						<ContentPresenter ContentSource="Content" Margin="20" />
						<Ellipse Fill="{TemplateBinding BorderBrush}" Margin="30">
							<Ellipse.Effect>
								<BlurEffect Radius="30" />
							</Ellipse.Effect>
							<Ellipse.Style>
								<Style TargetType="Ellipse">
									<Style.Triggers>
										<Trigger Property="IsMouseOver" Value="False">
											<Setter Property="Opacity" Value="0" />
										</Trigger>
										<Trigger Property="IsMouseOver" Value="True">
											<Setter Property="Opacity" Value="0.25" />
										</Trigger>
									</Style.Triggers>
								</Style>
							</Ellipse.Style>
						</Ellipse>
					</Grid>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>

	<Style x:Key="FadeTransitionContentControlStyle" TargetType="lmControls:TransitionContentControl">
		<Setter Property="IsTabStop" Value="False" />
		<Setter Property="Focusable" Value="False" />
		<Setter Property="ContentTemplate">
			<Setter.Value>
				<DataTemplate x:Name="FadeTransition">
					<Grid>
						<lmControls:Transition x:Name="t" Source="{Binding}" />
						<ContentControl x:Name="a" Visibility="Hidden" Content="{Binding ElementName=t, Path=DisplayA}" />
						<ContentControl x:Name="b" Visibility="Hidden" Content="{Binding ElementName=t, Path=DisplayB}" />
					</Grid>
					<DataTemplate.Triggers>
						<DataTrigger Binding="{Binding ElementName=t, Path=State}" Value="A">
							<Setter TargetName="a" Property="Panel.ZIndex" Value="1" />
							<Setter TargetName="a" Property="Visibility" Value="Visible" />
							<DataTrigger.EnterActions>
								<BeginStoryboard>
									<Storyboard>
										<DoubleAnimation
											Storyboard.TargetName="a" Storyboard.TargetProperty="Opacity"
											From="0" To="1" Duration="0:0:0.2" FillBehavior="HoldEnd" />
										<ObjectAnimationUsingKeyFrames 
											Storyboard.TargetName="b"
											Storyboard.TargetProperty="Visibility"
											Duration="0:0:0.2" FillBehavior="Stop">
											<DiscreteObjectKeyFrame KeyTime="0:0:0">
												<DiscreteObjectKeyFrame.Value>
													<Visibility>Visible</Visibility>
												</DiscreteObjectKeyFrame.Value>
											</DiscreteObjectKeyFrame>
										</ObjectAnimationUsingKeyFrames>
									</Storyboard>
								</BeginStoryboard>
							</DataTrigger.EnterActions>
						</DataTrigger>
						<DataTrigger Binding="{Binding ElementName=t, Path=State}" Value="B">
							<Setter TargetName="b" Property="Panel.ZIndex" Value="1" />
							<Setter TargetName="b" Property="Visibility" Value="Visible" />
							<DataTrigger.EnterActions>
								<BeginStoryboard>
									<Storyboard>
										<DoubleAnimation
											Storyboard.TargetName="b" Storyboard.TargetProperty="Opacity"
											From="0" To="1" Duration="0:0:0.2" FillBehavior="HoldEnd" />
										<ObjectAnimationUsingKeyFrames
											Storyboard.TargetName="a"
											Storyboard.TargetProperty="Visibility"
											Duration="0:0:0.2" FillBehavior="Stop">
											<DiscreteObjectKeyFrame KeyTime="0:0:0">
												<DiscreteObjectKeyFrame.Value>
													<Visibility>Visible</Visibility>
												</DiscreteObjectKeyFrame.Value>
											</DiscreteObjectKeyFrame>
										</ObjectAnimationUsingKeyFrames>
									</Storyboard>
								</BeginStoryboard>
							</DataTrigger.EnterActions>
						</DataTrigger>
					</DataTemplate.Triggers>
				</DataTemplate>
			</Setter.Value>
		</Setter>
	</Style>

	<Style x:Key="CenteredLegoContentControlStyle" TargetType="ContentControl">
		<Setter Property="IsTabStop" Value="False" />
		<Setter Property="Focusable" Value="False" />
		<Setter Property="Padding" Value="20" />
		<Setter Property="HorizontalAlignment" Value="Stretch" />
		<Setter Property="VerticalAlignment" Value="Stretch" />
		<Setter Property="HorizontalContentAlignment" Value="Center" />
		<Setter Property="VerticalContentAlignment" Value="Center" />
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="ContentControl">
					<Grid>
						<Rectangle Fill="LightGray" Opacity="0.35" />
						<Rectangle Opacity="0.25">
							<Rectangle.Fill>
								<VisualBrush Opacity="1" TileMode="Tile" Viewport="0,0,5,5 " ViewportUnits="Absolute">
									<VisualBrush.Visual>
										<Grid>
											<Path Stroke="Gray" Data="M 0,1 L 1,0 Z" />
										</Grid>
									</VisualBrush.Visual>
								</VisualBrush>
							</Rectangle.Fill>
						</Rectangle>
						<Grid
							Focusable="False"
							VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
							HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}">
							<Rectangle
								Fill="Black" Margin="-3"
								RadiusX="5" RadiusY="5"
								Opacity="0.15">
								<Rectangle.Effect>
									<BlurEffect Radius="10" />
								</Rectangle.Effect>
							</Rectangle>
							<Rectangle
								Fill="Black" Margin="-1"
								RadiusX="20" RadiusY="20"
								Opacity="0.15">
								<Rectangle.Effect>
									<BlurEffect Radius="4" />
								</Rectangle.Effect>
							</Rectangle>
							<Rectangle
								Fill="White"
								Stroke="Gray" StrokeThickness="0.5">
							</Rectangle>
							<ContentControl
								IsTabStop="False" Focusable="False"
								Content="{TemplateBinding Content}"
								Margin="{TemplateBinding Padding}"
								VerticalContentAlignment="Stretch"
								HorizontalContentAlignment="Stretch">
							</ContentControl>
						</Grid>
					</Grid>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>

	<Style TargetType="lmControls:CellControl" BasedOn="{StaticResource CellControlStyleDefault}" />
	<Style TargetType="lmControls:TapeControl" BasedOn="{StaticResource TapeControlStyleDefault}" />
	<Style TargetType="lmControls:ChildWindow" BasedOn="{StaticResource ChildWindowStyleDefault}" />
	<Style TargetType="lmControls:TransitionContentControl" BasedOn="{StaticResource FadeTransitionContentControlStyle}" />

</ResourceDictionary>